package m4d2;

import java.util.ArrayList;
import java.util.List;
//Stream流对集合数据过滤
public class mStream {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("adjvsd");
        list.add("aaa");
        list.add("bdj");
        list.add("adf");

        list.stream()    //通过stream流的方法，方法再通过函数式接口作为参数过滤
                .filter(name->name.startsWith("a"))
                .filter(name->name.length()==3)
                .forEach(name-> System.out.println(name));
    }
}
